<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
	<title>消息</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../../css/app.css" />
	<style type="text/css">
		.aui-title {
			font-size: .9rem;
			font-family: PingFangSC-Regular;
			font-weight: 500;
			color:rgba(255,255,255,1);
		}

		.news_wraper {
			text-align: center;
			height: 2.2rem;
			line-height: 2.2rem;
			font-size: .75rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(34, 34, 34, 1);
			background-color: #fff;
		}

		.system_news {
			margin-right: 4.1rem;
			height: 2.2rem;
			line-height: 2.2rem;
		}

		.tui_news {
			height: 2.2rem;
			line-height: 2.2rem;
		}

		.aui-linear_new {
			font-family: PingFangSC;
			font-weight: 500;
			color:rgba(0,90,147,1);
			border-bottom: 0.15rem solid rgba(0,90,147,1);
			border-radius: 0.05rem;
		}
	</style>
</head>

<body>
	<div id="aui-header" class="ming-bg-blue">
		<header class="aui-bar aui-bar-nav ming-bg-blue">
			<a class="aui-pull-left" tapmode onclick="close_win()" style="margin-left:.75rem;padding:0;">
				<img class="btn-img-back" src="../../image/btn/btn-back.png" />
			</a>
			<div class="aui-title">
				<div class="aui-text-linear" style="color:rgba(255,255,255,1);">
					我的消息
				</div>
			</div>
		</header>
		<div>
			<div class="news_wraper" style="display:flex;">
				<div style="flex:1;">
					<span style="display:inline-block;height:100%;" :class="{'aui-linear_new':index=='系统消息'}" tapmode onclick="tapindex('系统消息',1)">
									系统消息<span v-if="unread_sys_num>0" style=""></span>
					</span>
				</div>
				<div style="flex:1;">
					<span style="display:inline-block;height:100%;" :class="{'aui-linear_new':index=='推送消息'}" tapmode onclick="tapindex('推送消息',2)">
									推送消息<span v-if="unread_push_num>0" style=""></span>
					</span>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>

<script>
	var vm = new Vue({
		el: '#aui-header',
		data: {
			index: '系统消息',
			unread_sys_num:0,
			unread_push_num:0,
		},
	});
	apiready = function() {
		$api.fixStatusBar($api.byId('aui-header'))
		open_frame('my_message_f', 'my_message_f.html', 'aui-header', false)
		add_event('my_message', function(ret) {
         vm.unread_push_num = ret.unread_push_num;
				 vm.unread_sys_num = ret.unread_sys_num;
		})
		add_event('read_msg', function(ret) {
 		 if ($api.getStorage('type') == 1) {
 			 vm.unread_sys_num--;
 		 } else {
 			 vm.unread_push_num--;
 		 }

 	 })
	};

	function tapindex(index, type) {
		if (vm.index != index) {
			vm.index = index
		}
		send_event('message_list', {
			index: index,
			type: type
		})
	}
</script>

</html>
